package com.ktjiaoyu;

import com.ktjiaoyu.pojo.SysUser;
import com.ktjiaoyu.service.SysUserService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;

@SpringBootTest
@RunWith(SpringRunner.class)
public class SysUserServiceTester {
    @Resource
    SysUserService sysUserService;

    @Test
    public void test(){
        SysUser user = sysUserService.getUser(19l);
        System.out.println(user);
    }

    @Test
    public void test2(){
        SysUser sysUser=sysUserService.getUser(2l);
        sysUser.setUsrName("hlliu");
        sysUserService.updateUser(sysUser);
    }

    @Test
    public void test3(){
        SysUser sysUser=new SysUser();
        sysUser.setUsrName("zhangsan");
        sysUser.setUsrPassword("123456");
        sysUser.setUsrRoleId(1L);
        sysUser.setUsrFlag(1);

        sysUserService.addUser(sysUser);
    }

    @Test
    public void test4(){
        sysUserService.deleteUser(22l);
    }
}
